#pragma once

#include "rtmp/rtmpclientconnection.h"
#include "rtmp/rtmpnetconnection.h"
#include <memory>
#include <string>

using std::shared_ptr;
using std::wstring;
using std::string;

class Client : RTMPClientConnection::Listener{
public:
    Client(wstring tag);
    ~Client() = default;
    int Connect(const char* server,int port, const char* app);
    
    // RTMPClientConnection::Listener
    virtual void onConnected(RTMPClientConnection* conn);
	virtual void onNetStreamCreated(RTMPClientConnection* conn,RTMPClientConnection::NetStream *stream);
	virtual void onCommandResponse(RTMPClientConnection* conn,DWORD id,bool isError,AMFData* param);
	virtual void onDisconnected(RTMPClientConnection* conn);
private:
    wstring   _tag;
    string _server;
    string _app;
    int _port;
    shared_ptr<RTMPClientConnection> _pRtmpClient;
};